#include <iostream>
using namespace std;
const int N = 120;
char a[N][N];
int r, c, k;
int dx[2] = {-1, 0};
int dy[2] = {0, -1};
int sum = 0;
int main() {
    cin >> r >> c >> k;
    for(int i = 0; i < r; i++) {
        for(int j = 0; j < c; j++) {
            cin >> a[i][j];
        }
    }
    for(int i = 0; i < r; i++) {
        for(int j = 0; j < c; j++) {
            for(int g = 0; g < 2; g++) {
                int temp = 0;
                for(int l = 0; l < k; l++) {
                    if(i + dx[g] * l >= 0 && i + dx[g] * l < r && j + dy[g] * l >= 0 && j + dy[g] * l < c && a[i + dx[g] * l][j + dy[g] * l] == '.') {
                        temp++;
                    }
                }
                if(temp == k) {
                    sum++;
                }
            }
        }
    }
    if(k == 1)
        cout << sum / 2;
    else
        cout << sum;
    return 0;
}


/**
 * ai完善之后的代码
 * 更加简洁
 */
#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
    int R, C, K;
    cin >> R >> C >> K;
    
    // 动态分配矩阵
    vector<string> grid(R);
    long long dot_count = 0; // 统计 '.' 的数量
    bool all_empty = true;
    for (int i = 0; i < R; ++i) {
        cin >> grid[i];
        for (char c : grid[i]) {
            if (c == '#') all_empty = false;
            else dot_count++; // 计数 '.'
        }
    }
    
    // K = 1 特殊处理
    if (K == 1) {
        cout << dot_count << endl;
        return 0;
    }
    
    // 子任务 5-6：无障碍，直接计算
    if (all_empty) {
        long long ans = 1LL * R * (C - K + 1) + 1LL * C * (R - K + 1);
        cout << ans << endl;
        return 0;
    }
    
    // 通用解法：滑动窗口
    long long ans = 0;
    // 横向
    for (int i = 0; i < R; ++i) {
        for (int j = 0; j <= C - K; ++j) {
            bool valid = true;
            for (int k = 0; k < K; ++k) {
                if (grid[i][j + k] == '#') {
                    valid = false;
                    break;
                }
            }
            if (valid) ans++;
        }
    }
    
    // 纵向
    for (int j = 0; j < C; ++j) {
        for (int i = 0; i <= R - K; ++i) {
            bool valid = true;
            for (int k = 0; k < K; ++k) {
                if (grid[i + k][j] == '#') {
                    valid = false;
                    break;
                }
            }
            if (valid) ans++;
        }
    }
    
    cout << ans << endl;
    return 0;
}